package com.ruoyi.task;

import com.ruoyi.domain.AdvInoutstock;
import com.ruoyi.domain.AdvOrders;
import com.ruoyi.mapper.AdvInoutstockMapper;
import com.ruoyi.service.IAdvInoutstockService;
import com.ruoyi.system.service.ISysConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.time.Duration;
import java.time.Instant;
import java.util.List;

@Slf4j
@Component
public class DeviceHeartTask {

    @Autowired
    private ISysConfigService iSysConfigService;

    @Autowired
    private AdvInoutstockMapper advInoutstockMapper;

    /**
     * 修改在线时间的定时器
     * @throws IOException
     */
//    @Scheduled(cron = "0/8 * * * * ?")
    public void orderConfirm() throws IOException {
        String sys_hearttime = iSysConfigService.selectConfigByKey("sys_hearttime");
        advInoutstockMapper.updateByOnLine(sys_hearttime);
        advInoutstockMapper.updateByOffLine(sys_hearttime);
    }


}
